I've seen at least one BIOS which fails warm reboot if FPU exceptions
are pending.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
return 0;
}
-static void stop_this_cpu (void *dummy)
+static void __stop_this_cpu(void)
{
ASSERT(!local_irq_is_enabled());
disable_local_APIC();
+
hvm_cpu_down();
- cpu_clear(smp_processor_id(), cpu_online_map);
+ /*
+ * Clear FPU, zapping any pending exceptions. Needed for warm reset with
+ * some BIOSes.
+ */
+ clts();
+ asm volatile ( "fninit" );
+}
+static void stop_this_cpu(void *dummy)
+{
+ __stop_this_cpu();
+ cpu_clear(smp_processor_id(), cpu_online_map);
for ( ; ; )
halt();
}
mdelay(1);
local_irq_disable();
- disable_local_APIC();
+ __stop_this_cpu();
disable_IO_APIC();
- hvm_cpu_down();
local_irq_enable();
}